#pragma once

#include <grpc++/grpc++.h>
#include "../../proto/rpc.grpc.pb.h"
#include "../action.hpp"
#include "rsp_txn.hpp"


using grpc::ClientAsyncResponseReader;
using etcdserverpb::TxnResponse;
using etcdserverpb::KV;

namespace etcdv3 {
class AsyncUpdateAction : public Action {
public:
    AsyncUpdateAction(const ActionParameters& param);
    AsyncTxnResponse ParseResponse();
private:
    TxnResponse reply;
    std::unique_ptr<ClientAsyncResponseReader<TxnResponse>> reader;
};

}
